package com.cn.demo.springboot.shiro.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.cn.demo.springboot.shiro.entity.Menu;

@Mapper
public interface MenuMapper {
	
	
	@Insert("insert into sys_menu (menu_Name,menu_Code,parent_Code,list_Sort,level) value (#{menuName},#{menuCode},#{parentCode},#{listSort},#{level})")
	void insertMenu(Menu menu);
	
	@Select("select * from sys_menu where menu_Code = #{fuckYou} ")
	Menu findByMenuCode(String menuCode);
	
	@Update("update sys_menu set menu_Name=#{menuName} ,parent_Code=#{parentCode} ,list_Sort=#{listSort},level = #{level} where menu_Code = #{menuCode}")
	void updateMenu(Menu menu);
	
	@Select("select * from sys_menu")
	List<Menu> findAll();
	
	@Delete("delete from sys_menu where menu_id = #{menuId}")
	void delMenu(Menu menu);
	
}
